package com.github.prontera.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class OrderNoGenerator {

	public String getString() {
		return new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + getRandom620(3);
	}

	/**
	 * 获取6-10 的随机位数数字
	 */
	public String getRandom620(Integer length) {
		String result = "";
		Random rand = new Random();
		int n = 20;
		if (null != length && length > 0) {
			n = length;
		}
		int randInt = 0;
		for (int i = 0; i < n; i++) {
			randInt = rand.nextInt(10);
			result += randInt;
		}
		return result;
	}
}
